package basic

import "fmt"

func arr1() {
	var arr = [...]int{9, 2, 6, 7}
	maxIndex := -1
	maxValue := -1
	if len(arr) > 0 {
		fmt.Printf("数组的长度:%d \n", len(arr))
	}
	for i, v := range arr {
		if v > maxValue {
			maxIndex = i
			maxValue = v
		}
	}
	fmt.Println(maxIndex, maxValue)
}
func main() {
	arr1()
}
